Electronic apparatus control method performed through lid angle calculation, electronic apparatus thereof and software product

ABSTRACT

A method is provided for controlling an electronic apparatus on the basis of a value of a lid angle between a first hardware element accommodating a first magnetometer and a second hardware element accommodating a second magnetometer. The method includes acquiring, through the magnetometers, first signals representing an orientation of the hardware elements. A calibration parameter indicative of a condition of calibration of the magnetometers is generated on the basis of the first signals. A reliability value indicative of a condition of reliability of the first signals is generated on the basis of the first signals. A first intermediate value of the lid angle is calculated on the basis of the first signals. A current value of the lid angle is calculated on the basis of the calibration parameter, of the reliability value, and of the first intermediate value, and the electronic apparatus is controlled on the basis of the current value.

BACKGROUND Technical Field

The present disclosure relates to an electronic apparatus control method performed via calculation of an angle of lid opening, to an electronic apparatus thereof and to a software product.

Description of the Related Art

As illustrated in FIG. 1, a portable device 1 of a known type (e.g., a notebook) is typically formed by two functional blocks 2, 4, where the functional block 2 accommodates a screen 2 a and the functional block 4 accommodates a keypad 4 a and the control unit and memory 4 b, 4 c. The functional blocks 2 and 4 are coupled together by a pivot 6, configured for enabling a rotary movement of the functional block 2 with respect to the functional block 4. An angle α_(LID), known as opening angle or by the term “lid angle”, is formed between the functional block 2 (i.e., at the screen 2 a) and the functional block 4 (i.e., at the keypad 4 a). For instance, the angle α_(LID) is formed between respective surfaces of the functional block 2 and of the functional block 4. By convention, the angle α_(LID) is equal to 0° when the surface of the functional block 4 is parallel to and directly facing the surface of the functional block 2; and is equal to 360° when the surface of the functional block 4 is parallel to the surface of the functional block 2 but oriented in the opposite direction.

The measurement of the angle α_(LID) enables, for example, adaptation or modification of a user interface displayed by the screen 2 a in order to improve user experience of the portable device 1.

Moreover, it is desirable to measure the angle α_(LID) in portable devices such as tablets, foldable smartphones, and portable devices to which external keypads are operatively coupled (for example, integrated in a cover of the portable device and connected to the portable device by means of a wireless connection) in order to adapt or personalize the user interface or the configuration of the portable device and make available new possibilities of use thereof.

Known solutions for detecting the angle α_(LID) envisage the use of an accelerometer mounted on the functional block 2 and of an accelerometer mounted on the functional block 4. Said accelerometers supply data indicating the direction of the force of gravity with respect to respective systems of co-ordinates centered on the accelerometers themselves, thus making it possible to identify a position of the functional block 2 with respect to the functional block 4. However, this solution, being based exclusively upon the information deriving from the force gravity, does not make it possible to provide indications useful for all the possible orientations and arrangements in space of the portable device 1. In fact, this solution does not enable a reliable measurement if the portable device 1 is oriented with the pivot 6 parallel to the direction of the force of gravity (i.e., vertical position, or book-like position, of the portable device 1). Furthermore, the accelerometers are subject to environmental vibrational stimuli that may cause the measurement to be imprecise or wrong. In particular, given that accelerometers are sensitive to linear accelerations, the measurement of the angle α_(LID) is unreliable when the portable device is moving or else is subjected to external vibrations, for example when a person who is carrying the portable device is walking or is travelling in a means of transport. It is possible to use a filter (e.g., a lowpass filter) for reducing the effect of the linear accelerations on the measurement of the angle α_(LID), but this increases the response time in estimation of the angle α_(LID).

The patent document EP3407157 discloses a portable device analogous to the one illustrated in FIG. 1, where each functional block further includes a respective gyroscope. Gyroscopes are used in order to improve the reactivity of the measurement of the angle α_(LID) and to enable, through a data-fusion approach, said measurement to be made even when the portable device is rotated in the vertical position.

BRIEF SUMMARY

In various embodiments, the present disclosure provides an electronic apparatus control method performed through lid angle calculation, an electronic apparatus thereof and a software product that overcome the drawbacks of the prior art.

According to the present disclosure an electronic apparatus control method performed through lid angle calculation, an electronic apparatus thereof and a software product are provided.

In at least one embodiment, a method is provided for controlling at least one function of an electronic apparatus as a function of a value of a lid angle between a first hardware element and a second hardware element of the electronic apparatus. The first hardware element accommodates a first magnetometer and the second hardware element accommodates a second magnetometer and is orientable with respect to the first hardware element. The method includes: generating, by the first magnetometer and by the second magnetometer, first signals that are indicative of measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element; acquiring, by a processing unit of the electronic apparatus, the first signals; generating, by the processing unit and as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generating, by the processing unit and as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculating, by the processing unit, a first intermediate value of the lid angle based on the first signals; calculating, by the processing unit, a current value of the lid angle based on the calibration parameter, the reliability value, and the first intermediate value of the lid angle; and controlling the function of the electronic apparatus as a function of the current value of the lid angle.

In at least one embodiment, an electronic apparatus is provided that includes a first hardware element, a second hardware element, and a processing unit. The first hardware element accommodates a first magnetometer. The second hardware element accommodates a second magnetometer, orientable with respect to the first hardware element, and defining a lid angle with the first hardware element. The first and second magnetometers are configured for generating first signals that are measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element. The processing unit is configured to: acquire the first signals; generate, as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generate, as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculate a first intermediate value of the lid angle based on the first signals; calculate a current value of the lid angle based on the calibration parameter, of the reliability value, and the first intermediate value of the lid angle; and control the function of the electronic apparatus as a function of the current value of the lid angle.

In at least one embodiment, a non-transitory computer-readable medium is provided having contents which cause processing circuitry of an electronic apparatus to perform a method. The electronic apparatus includes a first hardware element accommodating a first magnetometer, and a second hardware element accommodating a second magnetometer, orientable with respect to the first hardware element, and defining a lid angle with the first hardware element, wherein the first and second magnetometers are configured for generating first signals that are measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element. The method includes: acquiring the first signals; generating, as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generating, as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculating a first intermediate value of the lid angle based on the first signals; calculating a current value of the lid angle based on the calibration parameter, the reliability value, and the first intermediate value of the lid angle; and controlling the function of the electronic apparatus as a function of the current value of the lid angle.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

For a better understanding of the present disclosure, a preferred embodiment thereof is now described purely by way of non-limiting example, with reference to the attached drawings, wherein:

FIG. 1 is a schematic perspective view of a portable device, in particular a notebook, configured for enabling calculation of an opening angle of the screen with respect to the keypad, according to an embodiment of a known type;

FIG. 2 is a schematic perspective view of a portable device, in particular a notebook, provided with magnetometers configured for enabling calculation of an opening angle of a screen with respect to a keypad, according to one embodiment;

FIG. 3 is a side view of the portable device of FIG. 2, in three operative conditions alternative to one another;

FIGS. 4A-4B are schematic perspective views of the portable device of FIG. 2 in respective further operative conditions;

FIG. 5 is a schematic illustration of functional blocks implemented by the portable device of FIG. 2, according to an embodiment of the present disclosure;

FIG. 5A is a schematic illustration of functional blocks included in one of the functional blocks of FIG. 5, according to an embodiment of the present disclosure;

FIG. 6 is a schematic perspective view of a portable device, in particular a notebook, provided with magnetometers and accelerometers configured for enabling calculation of an opening angle of a screen with respect to a keypad, according to a different embodiment;

FIG. 7 is a schematic illustration of functional blocks implemented by the portable device of FIG. 6, according to an embodiment of the present disclosure;

FIG. 8 is a schematic perspective view of a portable device, in particular a notebook, provided with magnetometers and gyroscopes configured for enabling calculation of an opening angle of a screen with respect to a keypad, according to a further embodiment; and

FIG. 9 is a schematic illustration of functional blocks implemented by the portable device of FIG. 8, according to an embodiment of the present disclosure.

DETAILED DESCRIPTION

Elements and steps common to different embodiments of the present disclosure are designated hereinafter by the same reference numbers.

With reference to FIG. 2, according to one aspect of the present disclosure, an electronic apparatus (in particular, a portable device) 10 is illustrated in a triaxial cartesian reference system XYZ defined by the axes X, Y and Z. In the reference system XYZ, a vector g (or acceleration vector g), which represents the gravity acceleration vector acting in a direction parallel to the axis Z and having an opposite orientation with respect thereto, and a vector B, which represents the Earth's magnetic field vector (hereinafter, magnetic field B or magnetic-field vector B), are considered. According to an aspect of the present disclosure, the magnetic field B acts in a plane YZ defined by the axes Y, Z, and in particular forms with the axis Y an inclination angle δ, for example equal to about 45°, and forms with the acceleration vector a respective angle, for example equal to the angle of inclination 6.

The device 10 is of a portable type (in particular, a notebook) and is here represented in an operative condition of open device. The portable device 10 includes a lid portion 12 and a base portion 14, mechanically coupled to each other by means of a hinge 15, which enables rotation of the lid portion 12 with respect to the base portion 14, forming a rotation constraint about a rotation axis R (or axis R), in FIG. 2 represented by way of example parallel to the axis X. The base portion 14 comprises at least one interface device 16 (e.g., a keypad and/or a trackpad), extending at a surface 14 a of the base portion 14. The lid portion 12 comprises a display region 18 (e.g., a screen or monitor), extending at a surface 12 a of the lid portion 12. In an operative condition of closed device, the surfaces 12 a, 14 a face one another. The lid portion 12 accommodates (e.g., integrates within it) a first magnetometer 20 configured for detecting and/or calculating the orientation, along respective sensing axes x₁, y₁, z₁, of the lid portion 12 with respect to the magnetic field B; and the base portion 14 accommodates (e.g., integrates within it) a second magnetometer 22, configured for detecting and/or calculating the orientation, along respective sensing axes x₂, y₂, z₂, of the base portion 14 with respect to the magnetic field B. The first and second magnetometers 20, 22 are configured for generating a first magnetic-field signal (hereinafter, first signal B₁) and, respectively, a second magnetic-field signal (hereinafter, second signal B₂). In general, the first and second magnetometers 20, 22 are configured to detect a change of orientation of the portable device 10 by means of measurements of the magnetic field B. The first and second magnetometers 20, 22 are, for example, magnetometers obtained with MEMS technology (e.g., MEMS magnetometers based upon AMR, Anisotropic MagnetoResistance, technology). In particular, the first signal B₁ is indicative of the components of the magnetic field B along the sensing axes x₁, y₁, z₁, and the second signal B₂ is indicative of the components of the magnetic field B along the sensing axes x₂, y₂, z₂.

It is here pointed out that, in the embodiment of the portable device 10 here considered, the axis R of the hinge 15 is always parallel to the sensing axes x₁, x₂ in any operative condition (lid portion 12 closed or open) and for any orientation of the device 10 in the triaxial reference system XYZ.

The portable device 10 further comprises a processing unit that includes a microcontroller or control unit 27 and a memory 28, coupled together. The control unit 27 and/or the memory 28 are moreover operatively coupled to the first and second magnetometers 20, 22 for receiving therefrom the respective signals B₁, B₂, generated according to operation in itself known of magnetometers. The signals B₁, B₂ received at input from the control unit 27 are processed as better described hereinafter with reference to FIG. 5.

In particular, the first and second magnetometers 20, 22 are configured to detect the variation of a mutual orientation between the lid portion 12 and the base portion 14 (for example, due to opening and closing, with respect to the base portion 14, of the lid portion 12 turning about the axis R due to the hinge 15). In this latter case, in particular, the first and second magnetometers 20, 22 are used for determining an opening angle α_(LID), supplementary to an angle between the sensing axis y₁ and the sensing axis y₂ of the respective first and second magnetometers 20, 22. The opening angle α_(LID) is therefore correlated to the angle existing between the surface 12 a of the lid portion 12 and the surface 14 a of the base portion 14 and is also known as “lid angle”. In use, it is possible to correlate the value of the lid angle α_(LID) with a use mode of the portable device 10 (e.g., a lid angle α_(LID) having a value of about 130° suggests a laptop-use mode, whereas a lid angle α_(LID) having a value of 360° suggests a tablet-use mode. It is therefore possible to adapt the graphic interface represented in the display region 18 to the type of operating mode, or else adapt other operating parameters of the portable device 10, for example enabling a touchscreen function when the tablet-use mode is detected, or vary other parameters still, such as switching-on/switching-off of the display region 18 or of the portable device 10 if the value the lid angle α_(LID) is greater/less than a certain threshold.

FIG. 3 illustrates, in lateral view in the plane YZ, the portable device 10 of FIG. 2, where the lid portion 12 is represented in three possible operative conditions S1-S3: lid portion 12 closed on the base portion 14, defining a lid angle α_(LID) of zero value (S1); lid portion 12 defining a lid angle α_(LID) of 90° with respect to the base portion 14 (S2); and lid portion 12 defining a lid angle α_(LID) of 180° with respect to the base portion 14 (S3).

In the operative conditions S1-S3, the lid angle α_(LID) is the relative angle between the sensing axis y₁ and the sensing axis y₂ of the magnetometers 20 and 22 (in detail, between the positive semi-axis of the axis y₁ and the negative semi-axis of the axis y₂) and, since it has been assumed that said sensing axes y₁, y₂ are parallel to the surfaces 12 a, 14 a of the lid portion 12 and the base portion 14, the lid angle α_(LID) is also the relative angle between the surfaces 12 a, 14 a of the lid portions 12 and the base portion 14. In other words, the lid angle α_(LID) coincides with the opening angle (or lid angle) of the lid portion 12 with respect to the base portion 14. The same angular quantity may likewise be defined between the axes z₁ and z₂ (in detail, between the positive semi-axis of the axis z₁ and the negative semi-axis of the axis z₂), which are always normal to the surfaces 12 a, 14 a.

Passing from the operative condition S1 to the operative condition S2 (or likewise from the operative condition S2 to the operative condition S3), the first magnetometer 20 detects a variation of the components of the magnetic field B along the axes z₁ and y₁, and this makes it possible to determine the fact that the lid angle α_(LID) increases (whereas the opposite is true, in the passage from the condition S2 to the condition S1, or from the condition S3 to the condition S2).

It may, in particular, be noted that the magnetic field B is given, in the operative condition S1, by first values detected on the axes y₁, z₁ and, in the operative condition S2, by second values detected on the axes y₁, z₁, said second values being different from the first values.

In order to calculate a value of the lid angle α_(LID), it is possible to exploit the projection of the magnetic field B on the respective three sensing axes of the first and second magnetometers 20, 22, taking into consideration the constraints due to the presence of the hinge 15. In this case, a value α_(LID_MAG) of the angle α_(LID) calculated via the magnetometers 20, 22 is obtained by applying the following expression:

$\begin{matrix} {\alpha_{{LID}\;\_\;{MAG}} = {{\arctan\; 2\left( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {{Gy}_{2} \cdot {Gz}_{1}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} \right)} + {\pi({rad})}}} & (1) \end{matrix}$

where arctan 2 is the known trigonometric function, Gz₁ is the component of the magnetic field B detected by the first magnetometer 20 along the sensing axis z₁, Gy₁ is the component of the magnetic field B detected by the first magnetometer 20 along the sensing axis y₁, Gz₂ is the component of the magnetic field B detected by the second magnetometer 22 along the sensing axis z₂, and Gy₂ is the component of the magnetic field B detected by the second magnetometer 22 along the sensing axis y₂. As represented by Eq. (1), the value α_(LID_MAG) measured via the magnetometers 20, 22 represents a relative orientation (i.e., an orientation that is not absolute in space) between the lid portion 12 and the base portion 14.

FIG. 4A shows a mode of use of the portable device 10 where the portable device 10 is oriented with the axis R parallel to the magnetic-field vector B. In this case, passage into the operative conditions S1-S2-S3 does not cause a variation of the component of magnetic field B along the sensing axes z₁, z₂, and y₁, y₂ of the first and second magnetometers 20, 22, since the components of the magnetic field B along the axes referred to are always zero or substantially zero (i.e., the values Gz₁, Gz₂, Gy₁, Gy₂ of Eq. (1) are approximately equal to zero). Consequently, in this situation the value α_(LID_MAG) cannot be calculated accurately. What has been described with reference to FIG. 4A may be applied, in a way in itself obvious, also to the operative condition (not illustrated) where the portable device 10 is oriented with the axis R parallel to the magnetic-field vector B, but rotated through 180° with respect to the orientation shown in FIG. 4A.

With reference to FIG. 4B an intermediate situation of orientation is shown, where the axis R forms with the magnetic-field vector B a reliability angle φ other than 0° and smaller than or equal to 90°. These intermediate situations of orientation lead to measurements of the value α_(LID_MAG) that are all the more erroneous, the more closely they approach the condition of FIG. 4A (axis R parallel to the magnetic-field vector B), i.e., the closer the reliability angle φ is to 0°.

In operative conditions where the sensing axes x₁ and x₂ are parallel to the magnetic field B and the sensing axes y₁ and y₂ are perpendicular to the magnetic field B (FIG. 4A), the components Gx₁ and Gx₂ have a maximum value, and the components Gy₁ and Gy₂ have a minimum value; instead, in operative conditions where the sensing axes x₁ and x₂ are perpendicular to the magnetic field B and the sensing axes y₁ and y₂ are parallel to the magnetic field B, the components Gx₁ and Gx₂ have a minimum value and the components Gy₁ and Gy₂ have a maximum value (the minimum and maximum values depend upon the type of inertial sensor used and are defined by the manufacturer).

The reliability of the calculation of the value α_(LID_MAG) is therefore correlated to a first reliability angle φ₁, which represents the measurement of the reliability angle φ made via the magnetometers 20, 22.

According to an aspect of the present disclosure, a first angle φ_(a) is calculated via the first magnetometer 20 according to the following expression:

$\begin{matrix} {\varphi_{a} = {\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{{Gx}_{1}}({rad})}} & (2) \end{matrix}$

The first angle φ_(a) therefore varies between 0° and 90°. Likewise, a second angle φ_(b) is calculated via the second magnetometer 22.

The first reliability angle φ₁ is correlated to the first angle φ_(a) and/or the second angle φ_(b). According to one aspect of the present disclosure, the first reliability angle φ₁ is equal to the first angle φ_(a) or to the second angle φ_(b); according to a different aspect of the present disclosure, the first reliability angle φ₁ is equal to an average (alternatively, a weighted average) of the first and second angles φ_(a), φ_(b).

If the first reliability angle φ₁ is greater than a threshold angle φ_(th), the measurement of the value α_(LID_MAG) is considered reliable; and if the first reliability angle φ₁ is smaller than or equal to the threshold angle φ_(th), the measurement of the value LID_MAG is considered unreliable. For instance, the threshold angle φ_(th) is equal to approximately 20°. Alternatively, the measurement of the value α_(LID_MAG) is considered reliable only if both of the angles φ_(a), φ_(b) are greater than the threshold angle φ_(th).

According to an aspect of the present disclosure, the control unit 27, with the possible support of the memory 28, is configured for executing the operations illustrated in FIG. 5 and described hereinafter. FIG. 5 is a schematic illustration of functional blocks implemented, via software and in an iterative way, by the control unit 27 and memory 28.

It is evident that the functional blocks of FIG. 5 can be implemented in hardware in a way in itself evident to the person skilled in the art.

In particular, at each instant (or iteration) t (e.g., 0<t<N, with N>1), the control unit 27 acquires the first signal B₁ and the second signal B₂ via the first magnetometer 20 and the second magnetometer 22, respectively. The first signal B₁ represents (e.g., comprises) the components Gx₁, Gy₁, and Gz₁ (in particular, Gx₁(t), Gy₁(t), and Gz₁(t)), and the second signal B₂ represents (e.g., comprises) the components Gx₂, Gy₂, and Gz₂ (in particular, Gx₂(t), Gy₂(t), and Gz₂(t)).

A calibration block 49 receives at input the components Gx₁(t), Gy₁(t), Gz₁(t), Gx₂(t), Gy₂(t), and Gz₂(t), and returns at output a first calibration value J₁, indicative of the possible presence of magnetic interference and magnetic distortion of the magnetometers 20, 22. In general, the first calibration value J₁ is correlated to a calibration reliability of the magnetometers 20, 22. The first calibration value J₁ may be a binary value in the case of single threshold (reliable/unreliable calibration, for example J₁=1 and, respectively, J₁=0), or else a value proportional to a degree of reliability of calibration detected.

The calibration block 49 is illustrated in detail in FIG. 5A, with reference to the case where the first calibration value J₁ assumes a binary value.

In a block 49 a, the first calibration value J₁ is initialised at 0 (unreliable calibration). In addition, in block 49 a the control unit 27 acquires, via the magnetometers 20, 22, calibration data D₁ (e.g., equal to the signals B₁, B₂, or else comprising a result of processing of the signals B₁, B₂ acquired in a first calibration interval). Furthermore, at the first iteration (t=1) there is performed, as better described hereinafter, a calibration in order to generate calibration parameters P_(cal) correlated to the electromagnetic conditions to which the magnetometers 20, 22 are subjected. In particular, the calibration parameters P_(cal) include a soft iron matrix (SI) and a hard-iron vector (HI), and are calculated in a way in itself known. Moreover, both at the first iteration (t=1) and at the subsequent iterations (t>1), calibrated data D₂ are generated on the basis of the calibration data D₁ and of the calibration parameters P_(cal). In detail, the calibrated data D₂ are the result of processing of the calibration data D₁ performed via the calibration parameters P_(cal).

In a block 49 b that follows block 49 a, a condition regarding calibration of the magnetometers 20, 22 is evaluated. In particular, it is determined whether it is necessary or desired to carry out a calibration of the magnetometers 20, 22. This calibration enables compensation of electromagnetic effects to which the magnetometers 20, 22 are subjected, due to factors such as variations in time of magnetization of components arranged in the proximity to the magnetometers themselves or the presence of ferromagnetic material. In detail, in block 49 b the control unit 27 compares the calibrated data D₂ with an expected range (e.g., defined between approximately 0.25 gauss and approximately 0.75 gauss), correlated to an expected intensity of the Earth's magnetic field. If a Euclidean norm |D₂| of the calibrated data D₂ satisfies, at the current iteration t, a first relation (e.g., it is comprised in said expected range and, for instance, is comprised between approximately 0.25 gauss and approximately 0.75 gauss, extremes included) the condition on the calibration of the magnetometers 20, 22 yields a negative result, and it is not necessary to carry out a new calibration; if the Euclidean norm |D₂| of the calibrated data D₂ does not satisfy, at the current iteration t, said first relation (e.g., it is not comprised in the expected range, and for instance it is less than 0.25 gauss or greater than 0.75 gauss) the condition on the calibration of the magnetometers 20, 22 yields a positive result, and it is necessary to carry out the new calibration.

If it is necessary to carry out calibration of the magnetometers 20, 22 (output “YES” from block 49 b), said calibration is carried out, according to known techniques (e.g., via sphere-fitting or ellipsoid-fitting algorithms), in a block 49 c, which follows block 49 b in the case of output “YES”. In detail, the portable device 10 is rotated freely in three-dimensional space by the operator, and simultaneously the control unit 27 acquires the signals B₁, B₂ during a second calibration interval, via the magnetometers 20, 22. The signals B₁, B₂ acquired during the second calibration interval are processed according to known techniques for generating new calibration parameters P_(cal), which replace the previous calibration parameters P_(cal). During the second calibration interval, the first calibration value J₁ is set at 0.

In a block 49 d following block 49 c, the first calibration value J₁ is set at 1, to indicate that the calibration is reliable.

If it is not necessary to carry out calibration of the magnetometers 20, 22 (output “NO” from block 49 b), a condition regarding magnetic interference (e.g., interference caused by electromagnetic sources set in the proximity of the portable device 10) is evaluated. In particular, in a block 49 e following block 49 b in the case of output “NO”, it is determined whether the magnetometers 20, 22 are subjected to magnetic interference. In particular, the calibrated data D₂ are evaluated in time to determine whether the magnetometers 20, 22 are subjected to magnetic interference. In greater detail, if the Euclidean norm |D₂| of the calibrated data D₂ satisfies a second relation (e.g., it does not vary significantly in time), the check on the condition regarding magnetic interference yields a negative result, and magnetic interference is not present; if the Euclidean norm |D₂| of the calibrated data D₂ does not satisfy the second relation (e.g., it varies significantly in time), the check on the condition regarding magnetic interference yields a positive result, and magnetic interference is present. For instance, the second relation is satisfied if the variance of the Euclidean norm |D₂| of the calibrated data D₂ is less than a given threshold.

If no magnetic interference is present (output “NO” from block 49 e), the procedure described of block 49 d is again carried out, and then the first calibration value J₁ is set at 1 to indicate that the calibration is reliable.

If magnetic interference is present (output “YES” from block 49 e), the first calibration value J₁ is set at 0 in a block 49 f following block 49 e in the case of output “YES”, to indicate that the calibration is unreliable.

At output from the calibration block 49, there is therefore the first calibration value J₁, which, if it is equal to 0, indicates that the calibration is unreliable (and therefore also the measurement of the value α_(LID_MAG) will not be reliable), whereas, if it is equal to 1, indicates that the calibration is reliable (and therefore the measurement of the value α_(LID_MAG) could be reliable, as described hereinafter).

With reference to FIG. 5, in a typical condition of use of the portable device 10, the base portion 14 lies in a horizontal plane XY, resting on an ideally flat surface. Since the magnetometers 20, 22 are in a fixed position and the orientation of the respective sensing axes is known, it is possible to calculate, via the control unit 27, the value α_(LID_MAG) (in particular, α_(LID_MAG)(t)) of the lid angle α_(LID) (in particular, α_(LID)(t)) as expressed by Eq. (1). In detail, a first calculation block 50 implements Eq. (1), receiving at input the components Gx₁(t), Gy₁(t), Gz₁(t), Gx₂(t), Gy₂(t), and Gz₂(t), and returning at output the value α_(LID_MAG)(t) of the lid angle α_(LID)(t).

A first reliability block 52 receives at input, from the first and second magnetometers 20, 22, the components Gx₁(t), Gy₁(t), Gz₁(t), Gx₂(t), Gy₂(t), and Gz₂(t) and implements Eq. (2) for calculating the first reliability angle φ₁ (in particular, φ₁(t)), as described previously. The first reliability angle φ₁(t) is then compared, as discussed previously, with the threshold angle φ_(a) to establish the reliability of the calculation of the value α_(LID_MAG)(t). The first reliability block 52 therefore generates at output a first reliability value K₁, which may be a binary value in the case of single threshold (reliable/unreliable, for example K₁=1 and, respectively, K₁=0), or else a value proportional to a degree of reliability detected. In this latter case, it is possible to envisage a plurality of thresholds of comparison of the first reliability angle φ₁(t), so that the first reliability value K₁ will vary according to a staircase function, associating a different first reliability value K₁ when each threshold provided is exceeded. The first reliability value K₁ will therefore vary between a minimum value and a maximum value the more the components Gx₁(t) and Gx₂(t) decrease and the components Gy₁(t), Gy₂(t), Gz₁(t) and Gz₂(t) increase; the minimum reliability value K₁ may be the zero value, whereas the maximum reliability value K₁ is chosen between 0 (excluded) and 1 according to the considerations that will be made in what follows with reference to block 56. Moreover, the first reliability value K₁ is correlated to the first calibration value J₁. In detail, if the first calibration value J₁ is equal to 0 (unreliable calibration), the first reliability value K₁ is set at 0 (measurement of the value α_(LID_MAG)(t) unreliable); if the first calibration value J₁ is equal to 1 (reliable calibration), the first reliability value K₁ is determined on the basis of what has been described previously. Likewise, if the first calibration value J₁ assumes said proportional values, the first reliability value K₁ is determined on the basis of what has been described previously and moreover is weighted as a function of the first calibration value J₁ in a known way (e.g., K₁=K₁·J₁).

A determination block 53 receives at input the first reliability value K₁ from the first reliability block 52 and the value α_(LID_MAG)(t) from the first calculation block 50, and determines the lid angle α_(LID)(t).

According to one embodiment, where the first reliability value K₁ assumes a binary value, the lid angle α_(LID)(t) is equal to the value α_(LID_MAG)(t) if K₁=1 (i.e., if the measurement of the value α_(LID_MAG)(t) is reliable), and is independent of the value α_(LID_MAG)(t) if K₁=0 (i.e., if the measurement of the value α_(LID_MAG)(t) is unreliable). For instance, if K₁=0 the lid angle α_(LID)(t) is not updated and therefore is equal to α_(LID_MAG) (t−1). In the case where at the first iteration (t=1) the measurement of the value α_(LID_MAG)(t) is not reliable, the lid angle α_(LID)(t) is set equal to a predefined value; for example, it is set equal to 0°.

According to a different embodiment, where the first reliability value K₁ assumes said proportional values, the lid angle α_(LID)(t) is calculated, on the basis of the value α_(LID_MAG)(t) and as a function of the first reliability value K₁, via a dynamic lowpass filter or a complementary filter. For instance, the lid angle α_(LID)(t) is calculated via the following expression:

α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′−α_(LID_MAG)(t)(rad)  (3)

where K₁′=n·K₁, with n=1 according to one aspect of the present disclosure or else, according to a different aspect of the present disclosure, 0<n=n_(max) (e.g., n_(max)=0.1) in order to reduce the noise of the magnetometers 20, 22. In the case where at the first iteration (t=1) the measurement of the value α_(LID_MAG)(t) is not reliable, the lid angle α_(LID)(t) is set equal to a predefined value; for example, it is set equal to 0°. In addition, at the first iteration (t=1), since the value α_(LID) (t−1) corresponding to the previous instant t−1 does not exist, α_(LID)(t) is, for example set at a value equal to α_(LID_MAG)(t), or else at a predefined value.

Alternatively, calculation of the lid angle α_(LID) may take into account directly and explicitly the first calibration value J₁. In this case, the first reliability value K₁ is not correlated to the first calibration value J₁ and, for example, Eq. (3) implemented in the determination block 53 is replaced by the following expression:

α_(LID)(t)=(1−J ₁ ·K ₁)·α_(LID)(t−1)+J ₁ ·K ₁·α_(LID_MAG)(t)(rad)  (3bis)

FIG. 6 shows the portable device 10 in a different embodiment, analogous to the one illustrated in FIG. 2.

In particular, with reference to the embodiment of FIG. 6, the lid portion 12 moreover accommodates (e.g., integrates within it) a first accelerometer 30, configured for detecting and/or calculating values of acceleration of the lid portion 12 along respective sensing axes x₃, y₃, z₃, parallel to the sensing axes x₁, y₁, z₁, respectively, of the first magnetometer 20; and the base portion 14 moreover accommodates (e.g., integrates within it) a second accelerometer 32, configured for detecting and/or calculating values of acceleration of the base portion 14 along respective sensing axes x₄, y₄, z₄, parallel to the sensing axes x₂, y₂, z₂, respectively, of the second magnetometer 22. It is here pointed out that, in the embodiment here considered, the axis R of the hinge 15 is always parallel to the sensing axes x₁, x₂, x₃, x₄ in any operative condition (lid portion 12 closed or open) and for any orientation of the device 10 in the triaxial reference system XYZ. The first and second accelerometers 30, 32 are operatively coupled to the control unit 27 and/or to the memory 28 and are configured to detect a movement and/or change of orientation of the portable device 10 by measuring accelerations. The first and second accelerometers 30, 32 are, for example, accelerometers obtained with MEMS technology.

In particular, as has been described with reference to FIG. 3, in the passage from the operative condition S1 to the operative condition S2 (or likewise from the operative condition S2 to the operative condition S3), the first accelerometer 30 detects a variation of the component of the acceleration of gravity g along the axes z₃ and y₃ and determines that the angle α_(LID) has increased (the reverse applies in the passage from the condition S2 to the condition S1, or from the condition S3 to the condition S2).

It is to be noted, in particular, that the acceleration of gravity g is given, in the operative condition S1, exclusively by the value detected along the axis z₃ and, in the operative condition S2, exclusively by the value detected along the axis y₃. In an intermediate condition, for example when the angle α_(LID) is equal to 45°, both of the axes y₃ and z₃ yield the same value of acceleration.

In the operative condition S1, the sensing axis z₃ is parallel to the gravity acceleration vector g (the projection of the gravity acceleration vector g on the axis z₃ is maximum), in the operative condition S2, the sensing axis z₃ is orthogonal to the gravity acceleration vector g (the projection of the gravity acceleration vector g on the axis z₃ is minimum), and in the operative condition S3, the sensing axis z₃ is parallel to the gravity acceleration vector g, but has an opposite orientation as compared to the operative condition S1 (the projection of the gravity acceleration vector g on the axis z₃ is maximum, but with opposite sign).

In order to calculate a value of the angle α_(LID), it is possible to exploit the projection of the gravity acceleration vector g on the respective three sensing axes of the first and second accelerometers 30, 32, taking into consideration the constraints due to the presence of the hinge 15. In this case, a value α_(LID_ACC) of the angle α_(LID) can be calculated as:

$\begin{matrix} {\alpha_{{LID}\;\_\;{ACC}} = {{\arctan\; 2\left( \frac{{{Az}_{4} \cdot {Ay}_{3}} - {{Ay}_{4} \cdot {Az}_{3}}}{{{Az}_{4} \cdot {Az}_{3}} + {{Ay}_{4} \cdot {Ay}_{3}}} \right)} + {\pi({rad})}}} & (4) \end{matrix}$

where arctan 2 is the known trigonometric function, Az₃ is the value of acceleration detected by the first accelerometer 30 along the sensing axis z₃, Ay₃ is the value of acceleration detected by the first accelerometer 30 along the sensing axis y₃, Az₄ is the value of acceleration detected by the second accelerometer 32 along the sensing axis z₄, and Ay₄ is the value of acceleration detected by the second accelerometer 32 along the sensing axis y₄. Eq. (4) shows how the value α_(LID_ACC) measured via the accelerometers 30, 32 represents a relative orientation (i.e., an orientation that is not absolute in space) between the lid portion 12 and the base portion 14.

When the portable device 10 is oriented with the axis R parallel to the axis Z, i.e., parallel to the gravity vector g (portable device 10 open like a book), passage into the operative conditions S1-S2-S3 does not cause a variation of the component of acceleration along the sensing axes z₃, z₄, y₃, and y₄ of the first and second accelerometers 30, 32 since the component of the acceleration of gravity g along the axes indicated is always zero or substantially zero (the values Az₃, Az₄, Ay₃, and Ay₄ of Eq. (4) are approximately equal to zero).

Situations of intermediate orientation, where the axis R forms an angle of less than 90°, but greater than 0°, with the axis Z, lead to measurements of the value α_(LID_ACC) that are all the more erroneous the more closely they approach the condition where the axis R is parallel to the axis Z.

What has been described previously may be applied, in a way in itself obvious, also to the operative condition where the portable device 10 is oriented with the axis R parallel to the axis Z, but rotated through 180° with respect to what has been discussed previously.

In particular, the reliability of the calculation of the value α_(LID_ACC) is therefore correlated to a second reliability angle φ₂, which represents the measurement of the reliability angle φ made via the accelerometers 30, 32.

According to one aspect of the present disclosure, a third angle φ_(c) is calculated via the first accelerometer 30 according to the following expression:

$\begin{matrix} {\varphi_{c} = {\tan^{- 1}\frac{\sqrt{{Ay}_{s}^{2} + {Az}_{s}^{2}}}{{Ax}_{s}}({rad})}} & (5) \end{matrix}$

where Ax₃ is the value of acceleration detected by the first accelerometer 30 along the sensing axis x₃. The third angle φ_(c) therefore varies between 0° and 90°. Likewise, a fourth angle φ_(d) is calculated via the second accelerometer 32.

The second reliability angle φ₂ is correlated to the third angle φ_(c) and/or to the fourth angle φ_(d), as has been described previously with reference to the first reliability angle (Pi.

If the second reliability angle φ₂ is greater than a further threshold angle (e.g., equal to the threshold angle φ_(th)), the measurement of the value α_(LID_ACC) is considered reliable, and if the second reliability angle φ₂ is smaller than or equal to said further threshold angle, the measurement of the value α_(LID_ACC) is considered unreliable. Alternatively, the measurement of the value α_(LID_ACC) is considered reliable only if both of the angles φ_(c), φ_(d) are greater than the further threshold angle.

In order to prevent the measurements of the angle α_(LID) from presenting an increasingly lower reliability the more closely they approach the condition of FIG. 4A (axis R parallel to the magnetic field B), as described for the portable device 10 of FIG. 2, in the embodiment of FIG. 6 the measurements obtained by the first and second accelerometers 30, 32 are fused with the measurements obtained by the first and second magnetometers 20, 22; for example, the measurements obtained from the first and second accelerometers 30, 32 are more weighted (and, accordingly, the measurements obtained from the first and second magnetometers 20, 22 are less weighted), the smaller the angle between the axis R and the magnetic field B (i.e., the more closely the condition of FIG. 4A is approached). In this way, the reliability of the measurement of the angle α_(LID) is guaranteed both when the axis R is parallel to the magnetic field B and when it is parallel to the acceleration of gravity g (i.e., parallel to the axis Z). Since the magnetic field B and the acceleration of gravity g are mutually orthogonal, the measurement of the angle α_(LID), made as described more fully hereinafter, is always reliable.

According to one aspect of the present disclosure, the control unit 27, with the optional support of the memory 28, is moreover operatively connected to the accelerometers 30, 32 and is configured for executing the operations illustrated in FIG. 7 and described hereinafter. FIG. 7 is a schematic illustration of functional blocks analogous to the ones illustrated in FIG. 5.

In particular, moreover, a second calculation block 55 is represented in FIG. 7 and configured for receiving at input the values of acceleration (comprising, in detail, the components Ay₃, Az₃, Ay₄ and Az₄) detected by the first and second accelerometers 30, 32, and calculating the value α_(LID_ACC) of the lid angle α_(LID) on the basis of Eq. (4).

Optionally, a second reliability block 54 is moreover present, receiving at input, from the first and second accelerometers 30, 32, the components Ax₃(t), Ay₃(t), Az₃(t), Ax₄(t), Ay₄(t), and Az₄(t), and implementing Eq. (5) for calculating the second reliability angle φ₂ (in particular, φ₂(t)). As has been described previously with reference to the first reliability angle (pi, the second reliability angle φ₂(t) is then compared with the further threshold angle to establish the reliability of the calculation of the value α_(LID_ACC)(t). The second reliability block 54 therefore generates at output a second reliability value K₂ analogous to the first reliability value K₁.

A first fusion block 56, replacing in FIG. 7 the determination block 53 of FIG. 5, has the function of generating a final value, deemed reliable, of the lid angle α_(LID) on the basis of the first reliability value K₁ and/or the second reliability value K₂. The first fusion block 56 receives at input the first reliability value K₁ and/or the second reliability value K₂ and both of the values α_(LID_MAG), α_(LID_ACC) calculated, respectively, according to Eq. (1) (i.e., using just the signals of the magnetometers 20, 22) and according to Eq. (4) (i.e., using just the signals of the accelerometers 30, 32).

According to one embodiment, the first fusion block 56 implements a lowpass filter that enables filtering of the noise of the magnetometers 20, 22 and the linear accelerations of the accelerometers 30, 32, said filter being defined by the following expression:

α_(LID)(t)=K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1)(rad)  (6)

where K_(LP) is a coefficient comprised between 0 and 1 (e.g., it is equal to 0.1) and α_(LID_ACC_MAG)(t) α_(LID_ACC_MAG)(t) is a value thus defined:

-   -   if K₁=0 and K₂≠0 (i.e., magnetometers 20, 22 unreliable, and         accelerometers 30, 32 reliable), then

α_(LID_ACC_MAG)(t)=α_(LID_ACC)(t)α_(LID_ACC_MAG)(t)

-   -   if K₁≠0 and K₂=0 (i.e., accelerometers 30, 32 unreliable, and         magnetometers 20, 22 reliable), then

α_(LID_ACC_MAG)(t)=α_(LID_MAG)(t)α_(LID_ACC_MAG)(t)=α_(LID_MAG)(t)

-   -   if K₁≠0 and K₂≠0 (i.e., accelerometers 30, 32 and magnetometers         20, 22 reliable), then

$\begin{matrix} {{\alpha_{{LID}\;\_\;{ACC}\;\_\;{MAG}}(t)} = \frac{{K_{1} \cdot {\alpha_{{LID}\;\_\;{MAG}}(t)}} + {K_{2} \cdot {\alpha_{{LID}\;\_\;{ACC}}(t)}}}{K_{1} + K_{2}}} & \; \end{matrix}$

i.e., the value α_(LID_ACC_MAG)(t) is a weighted average of the values α_(LID_MAG)(t) and α_(LID_ACC)(t), where the weights are the reliability parameters K₁, K₂.

Furthermore, if K₁=0 and K₂=0 (i.e., accelerometers 30, 32, and magnetometers 20, 22 unreliable), the coefficient K_(LP) is set at 0 in such a way that the estimate of the lid angle α_(LID)(t) is not updated, and therefore α_(LID)(t)=α_(LID)(t−1).

Moreover, optionally a further calibration block, of a type in itself known, analogous to the calibration block 49 and not illustrated, receives at input the components Ax₃(t), Ay₃(t), Az₃(t), Ax₄(t), Ay₄(t), and Az₄(t), verifies whether said components are calibrated and returns at output calibrated components (said components at output being equal to the components at input if the components at input are calibrated, and being different from the components at input if the components at input are not calibrated).

According to a different embodiment, illustrated in FIG. 8 and analogous to the one shown in FIG. 2, the lid portion 12 moreover accommodates (e.g., integrates within it) a first gyroscope 40, configured for detecting and/or calculating an orientation and rotation of the lid portion 12 along, and about, sensing axes l₁, m₁, n₁ that are parallel, respectively, to the sensing axes x₁, y₁, z₁ of the first magnetometer 20; and the base portion 14 moreover accommodates (e.g., integrates within it) a second gyroscope 42, configured for detecting and/or calculating an orientation and rotation of the base portion 14 along, and about, sensing axes l₂, m₂, n₂ that are parallel, respectively, to the sensing axes x₂, y₂, z₂ of the second magnetometer 22. It is here pointed out that, in the embodiment here considered, the axis R of the hinge 15 is always parallel to the sensing axes x₁, x₂, l₁, l₂ in any operative condition (lid portion 12 closed or open) and for any orientation of the device 10 in the triaxial reference system XYZ. The first and second gyroscopes 40, 42 are operatively coupled to the control unit 27 and/or to the memory 28 and are configured to detect a movement of the portable device 10 by measuring angular velocities. The first and second gyroscopes 40, 42 are, for example, gyroscopes obtained with MEMS technology.

In order to prevent the measurements of the angle α_(LID) from presenting an increasingly lower reliability, the closer they approach the condition of FIG. 4A (axis R parallel to the magnetic field B), as described for the portable device 10 of FIG. 2, in the embodiment of FIG. 8 the measurements obtained from the first and second gyroscopes 40, 42 are fused with the measurements obtained from the first and second magnetometers 20, 22; for example, the measurements obtained from the first and second gyroscopes 40, 42 are more weighted (and, accordingly, the measurements obtained from the first and second magnetometers 20, 22 are less weighted), the more the angle between the axis R and the magnetic field B decreases (i.e., the more closely the condition of FIG. 4A is approached). In this way, the reliability of the measurement of the angle α_(LID) is guaranteed even when the axis R is parallel to the magnetic field B.

The fusion of the measurements of the magnetometers 20, 22 with those of the gyroscopes 40, 42 is not carried out occasionally: as better described hereinafter, according to one aspect of the present disclosure, a complementary filter is used (but it is also possible to use other types of filtering, e.g., Kalman filtering), and the magnetometric component is rejected or attenuated, the more the angle between the axis R and the magnetic field B decreases. The magnetometric component specifically has the function of correcting the drift of the angle calculated by the gyroscopes 40, 42.

The gyroscopic contribution obtained by means of the measurements of the first and second gyroscopes 40, 42 acquired at the current instant t is given by

Δ_(α)=(ω_(x2)−ω_(x1))·dt(rad)  (7)

where ω_(x1) is the angular velocity measured by the first gyroscope 40 with respect to the sensing axis 11, ω_(x2) is the angular velocity measured by the second gyroscope 42 with respect to the sensing axis l₂. The value dt represents the time that has elapsed between the instant t−1 and the instant t (data-sampling or data-acquisition time of the gyroscopes 40, 42, which in turn may depend upon the updating time of the system, for example comprised between 25 Hz and 200 Hz). For instance, if sampling of the output of the gyroscopes 40, 42 occurs at 100 Hz, the parameter dt is equal to 0.01 s.

According to one aspect of the present disclosure, the control unit 27, with the possible support of the memory 28, is moreover operatively connected to the gyroscopes 40, 42 and is configured for executing the operations illustrated in FIG. 9 and described hereinafter. FIG. 9 is a schematic illustration of functional blocks analogous to the ones represented in FIG. 5.

In particular, FIG. 9 further comprises a third calculation block 58 configured for receiving at input the values of angular velocity ω_(x1), ω_(x2) detected by the first and second gyroscopes 40, 42, and calculating a value α_(LID_GYR) of the lid angle α_(LID) on the basis of Eq. (8) referred to in what follows.

For this purpose, the third calculation block 58 includes a sub-block 58 a configured for calculating (at the instant t) the variation Δ_(α) of the value α_(LID)(t) of the lid angle α_(LID)with respect to the value α_(LID)(t−1) previously measured (at the previous instant t−1), according to Eq. (7) provided above.

In addition, the third calculation block 58 includes a further sub-block 58 b, configured for receiving the variation value Δ_(α) and the last value α_(LID)(t−1) of the lid angle α_(LID) calculated and deemed reliable (e.g., generated at output from a second fusion block 60, described hereinafter), and updating in a recursive way said last value α_(LID)(t−1) of the lid angle α_(LID) using the variation value Δ_(α). The sub-block 58 b therefore implements the following expression:

α_(LID_GYR)(t)=Δ_(α)+α_(LID)(t−1)(rad)  (8)

The second fusion block 60 has the function of generating a final value, deemed reliable, of the lid angle α_(LID) on the basis of the first reliability value K₁ calculated by the first reliability block 52. The second fusion block 60 receives at input both of the values α_(LID_MAG)(t), α_(LID_GYR)(t) calculated according to Eq. (1) (i.e., using just the signals of the magnetometers 20, 22) and, respectively, according to Eq. (8) (i.e., by updating the value α_(LID)(t−1) with the variation Δ_(α) obtained via measurements supplied by the gyroscopes 40, 42).

According to one embodiment, the second fusion block 60 implements a complementary filter between the values α_(LID_MAG)(t) and α_(LID_GYR)(t), according to the following expression:

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·((ω_(x2)−ω_(x1))·dt+α _(LID)(t−1))

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·((ω_(x2)−ω_(x1))·dt+α _(LID)(t−1))  (9)

where K₁′=n·K₁, with n=1 according to one aspect of the present disclosure or else, according to a different aspect of the present disclosure, 0<n≤n_(max) (e.g., n_(max)=0.1) in order to reduce the noise of the magnetometers 20, 22.

In particular, since the value α_(LID) (t−1) does not exist at the first iteration (t=1), for example α_(LID)(t) is set at a value equal to α_(LID_MAG)(t) or else at a predefined value (e.g., 0°).

From an examination of the characteristics of the disclosure provided according to the present disclosure the advantages that it affords emerge clearly.

In particular, the operations of calculation of the lid angle α_(LID) between the lid portion 12 and the base portion 14 do not require the calculation of the absolute orientation of the lid portion 12 and of the base portion 14, unlike the prior art where measurements are made of absolute orientation in space of respective functional blocks, with respect to which it is desired to calculate a lid angle.

In particular, the presence of the magnetometers 20, 22 enables reduction of the overall cost of the portable device 10. In addition, the magnetometers 20, 22 are immune from effects due to linear accelerations and drift in time. The magnetometers 20, 22 guarantee a reliable measurement when the portable device 10 is open like a book (i.e., when the axis R is parallel to the acceleration of gravity g).

Furthermore, use of the first reliability value K₁, associated, as has been said, to an evaluation of reliability of the measurements obtained via the magnetometers 20, 22, makes the methodology of the present disclosure adaptive as a function of various operative conditions and of the service life of the magnetometers themselves.

Real-time calibration of the magnetometers 20, 22 prevents magnetic interference (block 49 e) and magnetic distortion (block 49 b) from affecting the measurement of the lid angle α_(LID).

With reference to the embodiment of FIG. 6, the simultaneous measurement made by the magnetometers 20, 22 and the accelerometers 30, 32 makes it possible, in addition to the advantages already listed with reference to FIG. 2, to guarantee, via the accelerometers 30, 32 a reliable measurement even in the case where the axis R is parallel to the magnetic field B, and in the case of magnetic anomalies.

With reference to the embodiment of FIG. 8, the simultaneous measurement made by the magnetometers 20, 22 and the gyroscopes 40, 42 makes it possible, in addition to the advantages already listed with reference to FIG. 2, to guarantee, via the gyroscopes 40, 42, a reliable measurement even in the case where the axis R is parallel to the magnetic field B. The gyroscopes 40, 42 moreover determine an ample bandwidth of the measurement of the lid angle α_(LID). In addition, this embodiment enables reliable measurements both in the case where the portable device 10 is open like a book and, simultaneously, magnetic anomalies are present and in the case where the portable device 10 is open like a book and is simultaneously subjected to shaking (and therefore to linear accelerations). The recursive use of formulae, in a closed-loop system, moreover makes the system as a whole stable, rapid, and with a low computational load required. In fact, the gyroscopes 40, 42 are not sensitive to high-frequency disturbance, as occurs, instead, for the accelerometers, or to magnetic disturbance, as occurs, instead, for the magnetometers; at the same time, the drawbacks associated to the calculation of the lid angle α_(LID) performed only by means of gyroscopes (storage of error and lack of knowledge of the initial lid angle upon switching-on of the portable device 10) are solved thanks to the simultaneous measurement made by the magnetometers 20, 22.

Finally, it is clear that modifications and variations may be made to the disclosure described and illustrated herein, without thereby departing from the scope thereof.

In general, in the context of the present disclosure, the lid angle α_(LID) is the angle between two elements (even separate from one another, i.e., not having the hinge 15) or parts that concur in forming an electronic device or system for display of information (electronic apparatus). Such elements or parts are for example: a keypad and a screen; a dual-screen device; a keypad and a tablet; a keypad and a smartphone; a smartphone and a tablet; two smartphones; two portions of display of a foldable smartphone; two tablets; or any other combination of keypad, tablet, smartphone, and screen.

Furthermore, it should be noted that the magnetometers 20, 22, the accelerometers 30, 32, and the gyroscopes 40, 42 may be implemented in: (i) modules separate from one another; (ii) 6-axes inertial-sensor modules (e.g., a first module integrating the first magnetometer 20 and the first accelerometer 30, and a second module integrating the second magnetometer 22 and the second accelerometer 32); (iii) 9-axes inertial-sensor modules (a first module integrating the first magnetometer 20, the first accelerometer 30, and the first gyroscope 40, and a second module integrating the second magnetometer 22, the second accelerometer 32, and the second gyroscope 42). In this latter case, it is also possible to make a 9-axes measurement for guaranteeing an accurate measurement of the lid angle α_(LID) in any condition of use and external factors of the portable device 10.

In some embodiments, a method for controlling at least one function of an electronic apparatus (10) as a function of a value of a lid angle (α_(LID)) between a first hardware element (12; 14) and a second hardware element (14; 12) of said electronic apparatus (10), wherein the first hardware element (12; 14) accommodates a first magnetometer (20; 22) and the second hardware element (14; 12) accommodates a second magnetometer (22; 20) and is orientable with respect to the first hardware element (12; 14), may be summarized as including the steps of: generating, by the first magnetometer (20) and by the second magnetometer (22), first signals (B1, B2) that are measurements of a magnetic field (B) external to the electronic apparatus (10) and are indicative of a relative orientation of the first hardware element with respect to the second hardware element; acquiring, by a processing unit (27, 28) of the electronic apparatus (10), said first signals (B1, B2); generating, by the processing unit (27, 28) and as a function of the first signals (B1, B2), a calibration parameter (J1) indicative of a condition of calibration of the first and second magnetometers (20, 22); generating, by the processing unit (27, 28) and as a function of the first signals (B1, B2), a reliability value (K1) indicative of a condition of reliability of the first signals (B1, B2); calculating (50), by the processing unit (27, 28), a first intermediate value (αLID_MAG) of said lid angle (αLID) on the basis of the first signals (B1, B2); calculating (53), by the processing unit (27, 28), a current value of said lid angle (αLID) on the basis of the calibration parameter (J1), of the reliability value (K1), and of said first intermediate value (αLID_MAG) of the lid angle (αLID); and controlling said function of the electronic apparatus (10) as a function of the current value of the lid angle (αLID).

In some embodiments, the first and second hardware elements (12, 14) are rotatable with respect to one another about a rotation axis (R), the first and second hardware elements (12, 14) have a respective first surface (12 a) and a respective second surface (14 a) directly faceable one another and defining between them the lid angle (αLID), and the first magnetometer (20) is a triaxial magnetometer having a respective first sensing axis (x1), a respective second sensing axis (y1), and a respective third sensing axis (z1), and the second magnetometer (22) is a triaxial magnetometer having a respective first sensing axis (x2), a respective second sensing axis (y2), and a respective third sensing axis (z2), the first sensing axes (x1, x2) being parallel to the rotation axis (R).

In some embodiments, the step of calculating the first intermediate value (αLID_MAG) includes executing the operation:

${\arctan\; 2\left( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {{Gy}_{2} \cdot {Gz}_{1}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} \right)} + \pi$

where Gy₁ is a component of the first signal (B₁) detected by the first magnetometer (20) along the respective second sensing axis (y₁), Gz₁ is a component of the first signal (B₁) detected by the first magnetometer (20) along the respective third sensing axis (z₁), Gy₂ is a component of the second signal (B₂) detected by the second magnetometer (22) along the respective second sensing axis (y₂), and Gz₂ is a component of the second signal (B₂) detected by the second magnetometer (22) along the respective third sensing axis (z₂).

In some embodiments, the step of generating the reliability value (K₁) includes: calculating a reliability angle (φ₁; φ_(a), φ_(b)) on the basis of the first signals (B₁, B₂); and generating the reliability value (K₁) on the basis of a comparison between the reliability angle (φ₁; φ_(a), φ_(b)) and a threshold angle.

In some embodiments, the reliability angle (φ₁) is measured between the rotation axis (R) and the magnetic field (B) external to the electronic apparatus (10), and wherein the step of calculating the reliability angle (φ₁) includes: calculating a first (φ_(a)) intermediate angle on the basis of the first signal (B₁) of the first magnetometer (20) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{{Gx}_{1}}$

and/or calculating a second (φ_(b)) intermediate angle on the basis of the first signal (B₂) of the second magnetometer (22) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{{Gx}_{2}}$

where Gx₁ is a component of the first signal (B₁) detected by the first magnetometer (20) along the respective first sensing axis (x₁), and Gx₂ is a component of the second signal (B₂) detected by the second magnetometer (22) along the respective first sensing axis (x₂); and generating the reliability angle (φ₁) on the basis of the first intermediate angle (φ_(a)) and/or of the second intermediate angle (φ_(b)), wherein: the reliability angle (φ₁) is equal to the first angle (φ_(a)); or the reliability angle (φ₁) is equal to the second angle (φ_(b)); or the reliability angle (φ₁) is equal to an average of the of the first and second angles (φ_(a), φ_(b)); or the reliability angle (φ₁) is equal to a weighted average of the first and second angles (φ_(a), φ_(b)).

In some embodiments, the step of generating the reliability value (K₁) includes:

calculating a first reliability angle (φ_(a)) on the basis of the first signals (B₁, B₂) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{{Gx}_{1}}$

where Gx₁ is a component of the first signal (B₁) detected by the first magnetometer (20) along the respective first sensing axis (x₁); calculating a second reliability angle (φ_(b)) on the basis of the first signals (B₁, B₂) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{{Gx}_{2}}$

where Gx₂ is a component of the second signal (B₂) detected by the second magnetometer (22) along the respective first sensing axis (x₂); and generating the reliability value (K₁) on the basis of a first comparison between the first reliability angle (φ_(a)) and a threshold angle and on the basis of a second comparison between the second reliability angle (φ_(b)) and said threshold angle.

In some embodiments, the step of generating the calibration parameter (J₁) includes: generating (49 a) calibrated data (D₂) on the basis of the first signals (B₁, B₂) through calibration parameters (P_(cal)); comparing the calibrated data (D₂) with respective comparison data, generating a result of said comparison that indicates a need or otherwise to calibrate the first and second magnetometers (20, 22); and if the result of said comparison indicates the need to calibrate the first and second magnetometers, executing the steps of: calibrating (49 c) the first and second magnetometers (20, 22) to generate new calibration parameters (P_(cal)), assigning (49 d) to the calibration parameter (J₁) a first value indicating execution of the calibration of the first and second magnetometers (20, 22), and replacing (49 c) said calibration parameters (P_(cal)) with the new calibration parameters (P_(cal)) generated by calibrating the first and second magnetometers (20, 22).

In some embodiments, the step of generating (49) the calibration parameter (J₁) further includes: if the result of said comparison does not indicate the need to calibrate the first and second magnetometers, executing the steps of: determining (49 e), on the basis of the calibrated data (D₂), whether a condition of magnetic interference has been verified at the first and second magnetometers (20, 22); and in the absence of said magnetic interference, assigning (49 d) to the calibration parameter (J₁) said first value; or in the presence of said magnetic interference, assigning (49 f) to the calibration parameter (J₁) a second value different from the first value.

In some embodiments, the reliability value (K₁) is a function of the calibration parameter (J₁), wherein the step of calculating (53) the current value of said lid angle (α_(LID)) comprises recursively updating said current value of the lid angle (α_(LID)) by executing the operation:

α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′·α_(LID_MAG)(t)

with K₁′=n·K₁, where K₁ is the reliability value and has a value equal to or greater than 0 and smaller than or equal to 1, n is a coefficient with a value greater than 0 and smaller than or equal to 1, α_(LID)(t) is the current value of the lid angle (α_(LID)), α_(LID)(t−1) is a value of the lid angle (α_(LID)) at an instant immediately preceding the instant of the current value α_(LID)(t), and α_(LID_MAG)(t) is the first intermediate value.

In some embodiments, the first hardware element (12; 14) further accommodates a first accelerometer (30; 32), and the second hardware element (14; 12) further accommodates a second accelerometer (32; 30), the control method further comprising the steps of: acquiring, by the processing unit (27, 28) through the first and second accelerometers (30, 32), second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating (55), by the processing unit (27, 28), a second intermediate value (α_(LID_ACC)) of said lid angle (α_(LID)) on the basis of the second signals; and calculating (56), by the processing unit (27, 28), said current value of the lid angle (α_(LID)) further on the basis of said second intermediate value (α_(LID_ACC)) of the lid angle (α_(LID)).

In some embodiments, the method further includes the step of generating (54), by the processing unit (27, 28) and as a function of the second signals, a further reliability value (K₂) indicative of a condition of reliability of the second signals.

In some embodiments, the step of calculating (56) the current value of the lid angle (α_(LID)) includes executing the operation:

K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1)

where α_(LID)(t−1) is a value of the angle at an instant immediately preceding the instant of the current value, K_(LP) is a coefficient greater than or equal to 0 and smaller than or equal to 1, and α_(LID_ACC_MAG)(t) is a value equal to: the second intermediate value (α_(LID_ACC)), if the reliability value (K₁) is equal to 0 and the further reliability value (K₂) is other than 0; or the first intermediate value (α_(LID_MAG)), if the reliability value (K₁) is other than 0 and the further reliability value (K₂) is equal to 0; or (K₁·α_(LID_MAG)(t)+K₂·α_(LID_ACC)(t))/(K₁+K₂), if the reliability value (K₁) is other than 0 and the further reliability value (K₂) is other than 0, where α_(LID_MAG)(t) is the first intermediate value, and α_(LID_ACC)(t) is the second intermediate value, K₁ is the reliability value and K₂ is the further reliability value, and where K_(LP) is equal to 0 if the reliability value (K₁) is equal to 0 and the further reliability value (K₂) is equal to 0.

In some embodiments, the first hardware element (12; 14) further accommodates a first gyroscope (40; 42) and the second hardware element (14; 12) further accommodates a second gyroscope (42; 40), the method further comprising the steps of: acquiring, by the processing unit (27, 28) and through the first and second gyroscopes (40, 42), second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating (58), by the processing unit (27, 28), a second intermediate value (α_(LID_GYR)) of said lid angle (α_(LID)) on the basis of the second signals; and calculating (60), by the processing unit (27, 28), said current value of the lid angle (α_(LID)) further on the basis of said second intermediate value (α_(LID_GYR)) of the lid angle (α_(LID)).

In some embodiments, the step of calculating the current value of the lid angle (α_(LID)) includes the step of executing a weighted sum of the first intermediate value (α_(LID_MAG)) and of the second intermediate value (α_(LID_GYR)).

In some embodiments, the step of executing the weighted sum includes executing the operation:

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·α_(LID_GYR)(t)

with K₁′=n·K₁, where K₁ is the reliability value and has a value equal to or greater than 0 and smaller than or equal to 1, n is a coefficient with a value greater than 0 and smaller than or equal to 1, α_(LID)(t) is the current value of the angle, α_(LID_MAG)(t) is the first intermediate value, and α_(LID_GYR)(t) is the second intermediate value.

In some embodiments, an electronic apparatus (10) may be summarized as including: a first hardware element (12; 14) accommodating a first magnetometer (20; 22); and a second hardware element (14; 12) accommodating a second magnetometer (22; 20), orientable with respect to the first hardware element (12), and defining a lid angle (α_(LID)) with said first hardware element (12; 14). The first and second magnetometers (20, 22) are configured for generating first signals (B₁, B₂) that are measurements of a magnetic field (B) external to the electronic apparatus (10) and are indicative of a relative orientation of the first hardware element with respect to the second hardware element. The electronic apparatus (10) further includes a processing unit (27, 28) configured for executing the operations of: acquiring said first signals (B₁, B₂); generating, as a function of the first signals (B₁, B₂), a calibration parameter (J₁) indicative of a condition of calibration of the first and second magnetometers (20, 22); generating, as a function of the first signals (B₁, B₂), a reliability value (K₁) indicative of a condition of reliability of the first signals (B₁, B₂); calculating (50) a first intermediate value (α_(LID_MAG)) of said lid angle (α_(LID)) on the basis of the first signals (B₁, B₂); calculating (53) a current value of said lid angle (α_(LID)) on the basis of the calibration parameter (J₁), of the reliability value (K₁), and of said first intermediate value (α_(LID_MAG)) of the lid angle (α_(LID)); and controlling said function of the electronic apparatus (10) as a function of the current value of the lid angle (α_(LID)).

In some embodiments, the first magnetometer (20) is a triaxial magnetometer having a respective first sensing axis (x₁), a respective second sensing axis (y₁), and a respective third sensing axis (z₁) sensing axis, and the second magnetometer (22) is a triaxial magnetometer having a respective first sensing axis (x₂), a respective second sensing axis (y₂), and a respective third sensing axis (z₂), the first sensing axes (x₁, x₂) being parallel to one another, and when said magnetic field (B) acts in a direction parallel to a rotation axis (R) about which the first and second hardware elements (12, 14) are rotatable with respect to one another, only the first sensing axes (x₁, x₂) are subject to the magnetic field (B), and the processing unit (27, 28) is configured for assigning to the reliability value (K₁) a predefined value indicative of unreliability of the first signals (B₁, B₂).

In some embodiments, the first hardware element (12; 14) further accommodates a first accelerometer (30; 32), the second hardware element (14; 12) further accommodates a second accelerometer (32; 30), and the processing unit (27, 28) is further configured for executing the operations of: acquiring, through the first and second accelerometers (30, 32), second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating (55) a second intermediate value (α_(LID_ACC)) of said lid angle (α_(LID)) on the basis of the second signals; and calculating (56) said current value of the lid angle (α_(LID)) further on the basis of said second intermediate value (α_(LID_ACC)) of the lid angle (α_(LID)).

In some embodiments, the first hardware element (12; 14) further accommodates a first gyroscope (40; 42), and the second hardware element (14; 12) further accommodates a second gyroscope (42; 40); and the processing unit (27, 28) is further configured for executing the operations of: acquiring, through the first and second gyroscopes (40, 42), second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating (58) a second intermediate value (α_(LID_GYR)) of said lid angle (α_(LID)) on the basis of the second signals; and calculating (60) said current value of the lid angle (α_(LID)) on the basis of said second intermediate value (α_(LID_GYR)) of the lid angle (α_(LID)).

In some embodiments, the first hardware element (12) is provided with a first user-interaction device (18) and the second hardware element (14) is provided with a second user-interaction device (16), and the operation of controlling said function of the electronic apparatus (10) comprises adapting operative features or operation features of the first interaction device (18) and/or of the second interaction device (16) as a function of the current value of the lid angle (α_(LID)).

In some embodiments, a software product is provided in which the software product is to be loaded into a processing unit (27, 28) of an electronic apparatus (10) comprising a first hardware element (12; 14) accommodating a first magnetometer (20; 22), and a second hardware element (14; 12) accommodating a second magnetometer (22; 20), orientable with respect to the first hardware element (12), and defining a lid angle (α_(LID)) with said first hardware element (12; 14); wherein the first and second magnetometers (20, 22) are configured for generating first signals (B₁, B₂) that are measurements of a magnetic field (B) external to the electronic apparatus (10) and are indicative of a relative orientation of the first hardware element with respect to the second hardware element, said software product being designed in such a way that, when it is run, the processing unit (27, 28) becomes configured for: acquiring said first signals (B₁, B₂); generating, as a function of the first signals (B₁, B₂), a calibration parameter (J₁) indicative of a condition of calibration of the first and second magnetometers (20, 22); generating, as a function of the first signals (B₁, B₂), a reliability value (K₁) indicative of a condition of reliability of the first signals (B₁, B₂); calculating (50) a first intermediate value (α_(LID_MAG)) of said lid angle (α_(LID)) on the basis of the first signals (B₁, B₂); calculating (53) a current value of said lid angle (α_(LID)) on the basis of the calibration parameter (J₁), of the reliability value (K₁), and of said first intermediate value (α_(LID_MAG)) of the lid angle (α_(LID)); and controlling said function of the electronic apparatus (10) as a function of the current value of the lid angle (α_(LID)).

The various embodiments described above can be combined to provide further embodiments. All of the U.S. patents, U.S. patent application publications, U.S. patent applications, foreign patents, foreign patent applications and non-patent publications referred to in this specification and/or listed in the Application Data Sheet are incorporated herein by reference, in their entirety. Aspects of the embodiments can be modified, if necessary to employ concepts of the various patents, applications and publications to provide yet further embodiments.

These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure. 

1. A method for controlling at least one function of an electronic apparatus as a function of a value of a lid angle between a first hardware element and a second hardware element of the electronic apparatus, wherein the first hardware element accommodates a first magnetometer and the second hardware element accommodates a second magnetometer and is orientable with respect to the first hardware element, comprising: generating, by the first magnetometer and by the second magnetometer, first signals that are indicative of measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element; acquiring, by a processing unit of the electronic apparatus, the first signals; generating, by the processing unit and as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generating, by the processing unit and as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculating, by the processing unit, a first intermediate value of the lid angle based on the first signals; calculating, by the processing unit, a current value of the lid angle based on the calibration parameter, the reliability value, and the first intermediate value of the lid angle; and controlling the function of the electronic apparatus as a function of the current value of the lid angle.
 2. The method according to claim 1, wherein the first and second hardware elements are rotatable with respect to one another about a rotation axis, wherein the first and second hardware elements have a respective first surface and a respective second surface directly faceable to one another and defining between them the lid angle, and wherein the first magnetometer is a triaxial magnetometer having a respective first sensing axis, a respective second sensing axis, and a respective third sensing axis, and the second magnetometer is a triaxial magnetometer having a respective first sensing axis, a respective second sensing axis, and a respective third sensing axis, the first sensing axes being parallel to the rotation axis.
 3. The method according to claim 2, wherein the calculating the first intermediate value includes executing the operation: ${\arctan\; 2\left( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {{Gy}_{2} \cdot {Gz}_{1}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} \right)} + \pi$ where Gy₁ is a component of the first signal detected by the first magnetometer along the respective second sensing axis, Gz₁ is a component of the first signal detected by the first magnetometer along the respective third sensing axis, Gy₂ is a component of the second signal detected by the second magnetometer along the respective second sensing axis, and Gz₂ is a component of the second signal detected by the second magnetometer along the respective third sensing axis.
 4. The method according to claim 3, wherein the generating the reliability value includes: calculating a reliability angle based on the first signals; and generating the reliability value based on a comparison between the reliability angle and a threshold angle.
 5. The method according to claim 4, wherein the reliability angle is measured between the rotation axis and the magnetic field external to the electronic apparatus, and wherein the calculating the reliability angle includes: calculating a first intermediate angle based on the first signal of the first magnetometer by executing the operation: $\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{{Gx}_{1}}$ or calculating a second intermediate angle based on the first signal of the second magnetometer by executing the operation: $\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{{Gx}_{2}}$ where Gx₁ is a component of the first signal detected by the first magnetometer along the respective first sensing axis, and Gx₂ is a component of the second signal detected by the second magnetometer along the respective first sensing axis; and generating the reliability angle based on the first intermediate angle or the second intermediate angle, wherein: the reliability angle is equal to the first angle, or the reliability angle is equal to the second angle, or the reliability angle is equal to an average of the of the first and second angles, or the reliability angle is equal to a weighted average of the first and second angles.
 6. The method according to claim 3, wherein the generating the reliability value includes: calculating a first reliability angle based on the first signals by executing the operation: $\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{{Gx}_{1}}$ where Gx₁ is a component of the first signal detected by the first magnetometer along the respective first sensing axis; calculating a second reliability angle based on the first signals by executing the operation: $\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{{Gx}_{2}}$ where Gx₂ is a component of the second signal detected by the second magnetometer along the respective first sensing axis; and generating the reliability value based on a first comparison between the first reliability angle and a threshold angle and based on a second comparison between the second reliability angle and the threshold angle.
 7. The method according to claim 1, wherein the generating the calibration parameter includes: generating calibrated data based on the first signals through calibration parameters; comparing the calibrated data with respective comparison data, generating a result of the comparison that indicates a need or otherwise to calibrate the first and second magnetometers; and if the result of the comparison indicates the need to calibrate the first and second magnetometers, then: calibrating the first and second magnetometers to generate new calibration parameters, assigning to the calibration parameter a first value indicating execution of the calibration of the first and second magnetometers, and replacing the calibration parameters with the new calibration parameters generated by calibrating the first and second magnetometers.
 8. The method according to claim 7, wherein the generating the calibration parameter further includes: if the result of the comparison does not indicate the need to calibrate the first and second magnetometers, then: determining, based on the calibrated data, whether a condition of magnetic interference has been verified at the first and second magnetometers; and in the absence of the magnetic interference, assigning to the calibration parameter the first value; or in the presence of the magnetic interference, assigning to the calibration parameter a second value different from the first value.
 9. The method according to claim 1, wherein the reliability value is a function of the calibration parameter, wherein the calculating the current value of the lid angle comprises recursively updating the current value of the lid angle by executing the operation: α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′·α_(LID_MAG)(t) with K₁′=n·K₁, where K₁ is the reliability value and has a value equal to or greater than 0 and smaller than or equal to 1, n is a coefficient with a value greater than 0 and smaller than or equal to 1, α_(LID)(t) is the current value of the lid angle, α_(LID)(t−1) is a value of the lid angle at an instant immediately preceding the instant of the current value α_(LID)(t), and α_(LID_MAG)(t) is the first intermediate value.
 10. The method according to claim 1, wherein the first hardware element further accommodates a first accelerometer, and the second hardware element further accommodates a second accelerometer, the control method further comprising: acquiring, by the processing unit through the first and second accelerometers, second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating, by the processing unit, a second intermediate value of the lid angle based on the second signals; and calculating, by the processing unit, the current value of the lid angle based on the second intermediate value of the lid angle.
 11. The method according to claim 10, further comprising generating, by the processing unit and as a function of the second signals, a further reliability value indicative of a condition of reliability of the second signals.
 12. The method according to claim 11, wherein the calculating the current value of the lid angle includes executing the operation: K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1) where α_(LID)(t−1) is a value of the angle at an instant immediately preceding the instant of the current value, K_(LP) is a coefficient greater than or equal to 0 and smaller than or equal to 1, and α_(LID_ACC_MAG)(t) is a value equal to: the second intermediate value, if the reliability value is equal to 0 and the further reliability value is other than 0; or the first intermediate value, if the reliability value is other than 0 and the further reliability value is equal to 0; or (K₁·α_(LID_MAG) (t)+K₂·α_(LID_ACC) (t))/(K₁+K₂), if the reliability value is other than 0 and the further reliability value is other than 0, where α_(LID_MAG)(t) is the first intermediate value, and α_(LID_ACC)(t) is the second intermediate value, K₁ is the reliability value and K₂ is the further reliability value, and where K_(LP) is equal to 0 if the reliability value is equal to 0 and the further reliability value is equal to
 0. 13. The method according to claim 1, wherein the first hardware element further accommodates a first gyroscope and the second hardware element further accommodates a second gyroscope, the method further comprising: acquiring, by the processing unit and through the first and second gyroscopes, second signals indicative of measurements of relative orientation of the first and second hardware elements; calculating, by the processing unit, a second intermediate value of the lid angle based on the second signals; and calculating, by the processing unit, the current value of the lid angle based on the second intermediate value of the lid angle.
 14. The method according to claim 13, wherein the calculating the current value of the lid angle includes executing a weighted sum of the first intermediate value and of the second intermediate value.
 15. The method according to claim 14, wherein the executing the weighted sum includes executing the operation: α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·α_(LID_GYR)(t) with K₁′=n·K₁, where K₁ is the reliability value and has a value equal to or greater than 0 and smaller than or equal to 1, n is a coefficient with a value greater than 0 and smaller than or equal to 1, α_(LID)(t) is the current value of the angle, α_(LID_MAG)(t) is the first intermediate value, and α_(LID_GYR)(t) is the second intermediate value.
 16. An electronic apparatus, including: a first hardware element accommodating a first magnetometer; a second hardware element accommodating a second magnetometer, orientable with respect to the first hardware element, and defining a lid angle with the first hardware element; and a processing unit, wherein the first and second magnetometers are configured for generating first signals that are measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element, and wherein the processing unit is configured to: acquire the first signals; generate, as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generate, as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculate a first intermediate value of the lid angle based on the first signals; calculate a current value of the lid angle based on the calibration parameter, of the reliability value, and the first intermediate value of the lid angle; and control the function of the electronic apparatus as a function of the current value of the lid angle.
 17. The electronic apparatus according to claim 16, wherein the first magnetometer is a triaxial magnetometer having a respective first sensing axis, a respective second sensing axis, and a respective third sensing axis sensing axis, and the second magnetometer is a triaxial magnetometer having a respective first sensing axis, a respective second sensing axis, and a respective third sensing axis, the first sensing axes being parallel to one another, and wherein, when the magnetic field acts in a direction parallel to a rotation axis about which the first and second hardware elements are rotatable with respect to one another, only the first sensing axes are subject to the magnetic field, and the processing unit is configured to assign to the reliability value a predefined value indicative of unreliability of the first signals.
 18. The electronic apparatus according to claim 16, wherein the first hardware element further accommodates a first accelerometer; wherein the second hardware element further accommodates a second accelerometer; and wherein the processing unit is further configured to: acquire, through the first and second accelerometers, second signals indicative of measurements of relative orientation of the first and second hardware elements; calculate a second intermediate value of the lid angle based on the second signals; and calculate the current value of the lid angle based on the second intermediate value of the lid angle.
 19. The electronic apparatus according to claim 16, wherein the first hardware element further accommodates a first gyroscope, and the second hardware element further accommodates a second gyroscope; and wherein the processing unit is further configured to: acquire, through the first and second gyroscopes, second signals indicative of measurements of relative orientation of the first and second hardware elements; calculate a second intermediate value of the lid angle based on the second signals; and calculate the current value of the lid angle based on the second intermediate value of the lid angle.
 20. The apparatus according to claim 16, wherein the first hardware element is associated with a first user-interaction device and the second hardware element is associated with a second user-interaction device, and wherein the controlling the function of the electronic apparatus comprises adapting operative features or operation features of the first interaction device or of the second interaction device as a function of the current value of the lid angle.
 21. A non-transitory computer-readable medium having contents which cause processing circuitry of an electronic apparatus to perform a method, the electronic apparatus comprising a first hardware element accommodating a first magnetometer, and a second hardware element accommodating a second magnetometer, orientable with respect to the first hardware element, and defining a lid angle with the first hardware element, wherein the first and second magnetometers are configured for generating first signals that are measurements of a magnetic field external to the electronic apparatus and are indicative of a relative orientation of the first hardware element with respect to the second hardware element, the method comprising: acquiring the first signals; generating, as a function of the first signals, a calibration parameter indicative of a condition of calibration of the first and second magnetometers; generating, as a function of the first signals, a reliability value indicative of a condition of reliability of the first signals; calculating a first intermediate value of the lid angle based on the first signals; calculating a current value of the lid angle based on the calibration parameter, the reliability value, and the first intermediate value of the lid angle; and controlling the function of the electronic apparatus as a function of the current value of the lid angle. 